import { getColumnsData } from "../common";

const userAddressListTable = [
  {
    user_id: "ID: 4997", // 用户ID
    user_name: "账号: 15555555555", // 用户账号
    receiving_name: "张三", // 收货人姓名
    receiving_mobile: "15555555555", // 收货人电话
    use_time: "2023-06-09 16:55:02", // 使用时间
    province: "广东省", // 省份
    city: "深圳市", // 城市
    area: "福田区", // 区县
    address: "福田区XXXXXX菜鸟驿站", // 详细地址
    is_default: "是", // 是否默认地址
    create_time: "2023-06-09 16:55:02" // 领取时间
  }
];

const headerList = [
  {
    width: "100px",
    label: "编号",
    prop: "id",
    sortable: true
  },
  {
    width: "180px",
    label: "用户信息",
    showValue: [
      {
        class: "",
        key: "user_id",
        tableType: "userAddressList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      },
      {
        class: "",
        key: "user_name",
        tableType: "userAddressList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  },
  {
    width: "150px",
    label: "收货人姓名",
    prop: "receiving_name"
  },
  {
    width: "150px",
    label: "收货人电话",
    prop: "receiving_mobile"
  },
  {
    width: "200px",
    label: "使用时间",
    prop: "use_time"
  },
  {
    width: "120px",
    label: "省份",
    prop: "province"
  },
  {
    width: "120px",
    label: "城市",
    prop: "city"
  },
  {
    width: "120px",
    label: "区县",
    prop: "area"
  },
  {
    width: "200px",
    label: "详细地址",
    prop: "address"
  },
  {
    width: "120px",
    label: "是否默认地址",
    prop: "is_default"
  },
  {
    width: "200px",
    label: "添加时间",
    prop: "create_time"
  },
  {
    label: "操作",
    width: "120px",
    hideCheck: true,
    fixed: "right",
    showValue: [
      {
        class: "",
        key: "编辑",
        cellType: "button",
        type: "primary", // 按钮类型
        buttonType: "edit",
        tableType: "userAddressList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      },
      {
        class: "",
        key: "删除",
        cellType: "button",
        type: "danger", // 按钮类型
        buttonType: "delete",
        tableType: "userAddressList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  }
];

const userAddressListColumns = [];

getColumnsData("userAddressList", userAddressListColumns, headerList, res => {
  console.log("userAddressList", res);
});
export { userAddressListTable, userAddressListColumns };
